﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 重载1
{
    class Square
    {
        //圆的面积， 长方形的面积
        private double _length;
        private double _width;
        private double _radius;

        public double Length
        {
            get
            {
                return this._length;
            }
            set
            {
                this._length = value;
            }
        }
        public double Width
        {
            get
            {
                return this._width;
            }
            set
            {
                this._width = value;
            }
        }
        public double Radius
        {
            get
            {
                return this._radius;
            }
            set
            {
                this._radius = value;
            }
        }

        public void SquareResult(double radius)
        {
            this.Radius = radius;
            double square = 3.14 * this.Radius * this.Radius;
            Console.WriteLine("圆的面积为{0}",square);
        }
        public void SquareResult(double length , double width)
        {
            this.Length = length;
            this.Width = width;
            Console.WriteLine("长方形的面积为{0}", this.Length*this.Width);
        }
    }
}
